<#if parentId?has_content>
<ul>
     <@cms.categoryList advanced=true parentId=parentId pageSize=500>
    <#list page.list as a>
        <@t.merge 'categoryIds' a.id!/>
    </#list>
    <@cms.categoryModel modelId=modelId categoryIds=t.categoryIds><#assign categoryModelMap=map/></@cms.categoryModel>
    <#list page.list as a>
        <li<#if a.childIds?has_content> _src="cmsCategory/lookupByModelId.html?currentCategoryId=${currentCategoryId!}&modelId=${modelId!}&parentId=${a.id}&field=${field!'categoryId'}"</#if>>
            <a href="javascript:;"<#if (!currentCategoryId?has_content||a.id?string!=currentCategoryId)&&categoryModelMap?has_content&&categoryModelMap[a.id?string]?has_content> onclick="$.bringBack({${field!'categoryId'}:'${a.id}', categoryName:'${a.name}'});return false;" class="exclude-translate"<#else> class="disabled exclude-translate"</#if>>${a.name!}</a>
        </li>
    </#list>
    </@cms.categoryList>
</ul>
<#else>
<div class="pageFormContent" layoutH>
    <ul class="tree treeFolder">
        <@cms.categoryList advanced=true parentId=parentId pageSize=500>
        <#list page.list as a>
            <@t.merge 'categoryIds' a.id!/>
        </#list>
        <@cms.categoryModel modelId=modelId categoryIds=t.categoryIds><#assign categoryModelMap=map/></@cms.categoryModel>
        <#list page.list as a>
            <li<#if a.childIds?has_content> _src="cmsCategory/lookupByModelId.html?currentCategoryId=${currentCategoryId!}&modelId=${modelId!}&parentId=${a.id}&field=${field!'categoryId'}"</#if>>
                <a href="javascript:;" class="exclude-translate"<#if (!currentCategoryId?has_content||a.id?string!=currentCategoryId)&&categoryModelMap?has_content&&categoryModelMap[a.id?string]?has_content> onclick="$.bringBack({${field!'categoryId'}:'${a.id}', categoryName:'${a.name}'});return false;"</#if>>${a.name!}</a>
            </li>
        </#list>
        </@cms.categoryList>
    </ul>
</div>
<div class="formBar">
    <ul>
        <li><a class="button" href="javascript:;" onclick="$.bringBack({${field!'categoryId'}:'',categoryId:'', categoryName:'',parentId:''});return false;"><@t.page 'button.clear_select'/></a>
        <li><button type="button" class="button close"><@t.page 'button.close'/></button></li>
    </ul>
</div>
</#if>